<%--
  Created by IntelliJ IDEA.
  User: 任旭旺
  Date: 2020/6/1
  Time: 10:22
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <c:set var="request" value="${pageContext.request.contextPath}"/>
    <title>layuiAdmin 文章管理 iframe 框</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${request}/static/plugins/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${request}/static/plugins/layuiadmin/style/admin.css" media="all">

</head>
<body>
<div class="style" style="align-content: center">
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list"
     style="padding: 20px 30px 0 0;">

    <div class="layui-form-item" style="text-align: center">
        <label class="layui-form-label">开始时间</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="beginTime" name="beginTime" lay-verify="vacationBegin">
        </div>
    </div>

    <div class="layui-form-item" style="text-align: center">
        <label class="layui-form-label">结束时间</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="endTime" name="endTime" lay-verify="vacationEnd">
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label" style="text-align: center">请假事由</label>
        <div class="layui-input-inline">
            <textarea id="reason" name="reason" style="width: 400px; height: 150px;" class="layui-textarea" ></textarea>
        </div>
        <div class="layui-form-mid layui-word-aux"></div>
    </div>

    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="layuiadmin-app-form-submit" id="layuiadmin-app-form-submit"
               value="确认添加">
        <input type="button" lay-submit lay-filter="layuiadmin-app-form-edit" id="layuiadmin-app-form-edit"
               value="确认编辑">
    </div>
</div>
</div>
<script src="${request}/static/plugins/layuiadmin/layui/layui.js"></script>
<script src="${request}/static/custom/js/myLayVerify.js"></script>
<script src="${request}/static/custom/js/myValidity.js"></script>
<script>
    layui.config({
        base: '${request}/static/plugins/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'form','laydate'], function () {
        var $ = layui.$
            , form = layui.form
            , laydate = layui.laydate;


        let start = laydate.render({
            elem: '#beginTime' //指定元素
            ,value: '2020-6-1'
            ,isInitValue: false //是否允许填充初始值，默认为 true'
            ,min: '1920-1-1'
            ,max: '2099-12-31'
            ,done:function (value,date,endDate) {
                end.config.min={
                    year:date.year,
                    month:date.month-1,
                    date:date.date+1,
                };//开始日期选好后，重置结束日最小日期
                end.config.value = {
                    year:date.year,
                    month:date.month-1,
                    date:date.date,
                };//将结束日的初始值设定为开始日
            }
        });
        //结束日期
       let end = laydate.render({
            elem: '#endTime' //指定元素
            ,isInitValue: false //是否允许填充初始值，默认为 true'
            ,done:function (value , date , endDate) {
                start.config.max = {
                    year:date.year,
                    month:date.month-1,
                    date:date.date-1,
                };//选择结束日期后重设开始日期最大值
           }

        });


    })
</script>

</body>
</html>
